<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:if test="%{total>1}">
	<DIV class="page_navi">
		<s:if test="%{page>0}">
			<s:if test="page>1"><A href="?page=<s:property value="page-1"/>&keyword=${param.keyword}">《 </A></s:if>
			<s:if test="page==1"><A href="?page=<s:property value="page"/>&keyword=${param.keyword}">《 </A></s:if>
						<a <s:if test="%{page==1}">class="current"</s:if>
						href="?page=1&keyword=${param.keyword}">1</a>
		</s:if>
		<s:if test="%{total<11}">
		<s:iterator begin="1" end="%{total}" step="1">
			<a <s:if test="%{top==page}">class="current"</s:if>
				href="?page=<s:property value="top"/>&keyword=${param.keyword}"><s:property value="top" />
			</a>
		</s:iterator>
		</s:if>
		<s:else>
			<s:if test="%{page<=3 || total-4<page}">
				<s:iterator begin="2" end="6">
					<a <s:if test="%{top==page}">class="current"</s:if>
						href="?page=<s:property value="top"/>&keyword=${param.keyword}"><s:property value="top" />
					</a>
				</s:iterator>
			</s:if>
			<s:else>
				<s:iterator begin="%{page-2}" end="%{page}">
					<a <s:if test="%{top==page}">class="current"</s:if>
						href="?page=<s:property value="top"/>&keyword=${param.keyword}"><s:property value="top" />
					</a>
				</s:iterator>
				
				<s:iterator begin="%{page+1}" end="%{page+4}">
					<a <s:if test="%{top==page}">class="current"</s:if>
						href="?page=<s:property value="top"/>&keyword=${param.keyword}"><s:property value="top" />
					</a>
				</s:iterator>
				</s:else>
				<s:iterator begin="%{total-3}" end="%{total}">
					<a <s:if test="%{top==page}">class="current"</s:if>
						href="?page=<s:property value="top"/>&keyword=${param.keyword}"><s:property value="top" />
					</a>
				</s:iterator>
			</s:else>
		<s:if test="%{total>page}">
			<A href="?page=<s:property value="page+1"/>&keyword=${param.keyword}">》 </A>
		</s:if>
		<s:elseif test="%{total=page}">
			<A href="?page=<s:property value="total"/>&keyword=${param.keyword}">》 </A>
		</s:elseif>
	</DIV>
</s:if>